package org.mockserver.maven;

import org.mockserver.client.server.MockServerClient;
import org.mockserver.model.HttpRequest;

import static org.mockserver.matchers.Times.exactly;
import static org.mockserver.model.HttpForward.Scheme.HTTP;
import static org.mockserver.model.HttpForward.forward;

/**
 * Created by liuyu21 on 2017/10/16.
 */
public class TestMain {

    public static void main(String[] args) {
        new MockServerClient("127.0.0.1", 1081)
                .when(
                        HttpRequest.request()
                                .withMethod("GET")
                                .withPath("/index.html"),
                        exactly(1)
                )
                .forward(
                        forward()
                                .withHost("www.mock-server.com")
                                .withPort(80)
                                .withScheme(HTTP)
                );
    }
}
